package com.joyer.exception;

import java.util.Map;

/**
 * 业务异常
 * 
 * @author wangzhiyuan
 *
 */
public class BusinessException extends RuntimeException {

	private static final long serialVersionUID = 1L;

	private String errorCode = "200";

	public BusinessException() {
		super();
	}

	public BusinessException(Map<String, Object> map) {
		super((String) map.get("errmsg"));
		String errcode = (String) map.get("errcode");
		setErrorCode(errcode);
	}

	public BusinessException(String message) {
		super(message);
	}

	public BusinessException(String message, String errorCoede) {
		super(message);
		this.errorCode = errorCoede;
	}

	public BusinessException(String message, Throwable cause) {
		super(message, cause);
	}

	public BusinessException(Throwable cause) {
		super(cause);
	}

	public String getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(String errorCode) {
		this.errorCode = errorCode;
	}

}
